package com.jeomo.masterdata.starter.mapper;

import com.jeomo.base.starter.mapper.IBaseMapper;
import com.jeomo.masterdata.starter.entity.Goods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: qbt
 * @Date: 2020/3/8 15:35
 * @Version 1.0
 */
@Mapper
public interface GoodsMapper extends IBaseMapper<Goods> {

    @Select("SELECT `code` FROM master_goods WHERE merchant_code = #{merchantCode} order by `code` DESC LIMIT 1 ")
    String queryRecentlyCode(String merchantCode);

    /**
     * 查询商户下的所有商品
     *
     * @param merchantCode
     * @return
     */
    @Select("SELECT * FROM master_goods WHERE merchant_code = #{merchantCode}")
    List<Goods> queryGoodsByMerchant(String merchantCode);

    /**
     * @param merchantCode
     * @description: 根据商户code列表返回商品实体
     * @return: java.util.List<com.jeomo.masterdata.starter.entity.Goods>
     * @author: 崔贺
     * @time: 2020/11/6 10:29
     */
    List<Goods> selectGoodsByMerchantCodes(String merchantCode);

    /**
     * @param GoodsTypeCodes
     * @description: 根据品类code列表返回商品实体
     * @return: java.util.List<com.jeomo.masterdata.starter.entity.Goods>
     * @author: 崔贺
     * @time: 2020/11/6 14:54
     */
    List<Goods> selectGoodsByGoodsTypeCodes(List<String> GoodsTypeCodes);

    /**
     * @param tobCodes
     * @description: 根据业态code列表返回商品实体
     * @return: java.util.List<com.jeomo.masterdata.starter.entity.Goods>
     * @author: 崔贺
     * @time: 2020/11/16 9:52
     */
    List<Goods> selectGoodsByTobCodes(List<String> tobCodes);
}
